package com.wanxi.test;

import java.util.Scanner;

public class PrintEven {

    public static void main(String[] args) {
        /**
         * 思路：
         * 1.定义一个初始值 1
         * 2.定义一个末尾值 10
         * 3.定义for
         * 4.判断是否为奇偶数
         * 5.打印
         */
        int start = getNum("请输入第一个整数");
        int end = getNum("请输入第二个整数");
        judge(start, end);
    }

    /**
     * @param tips
     * @return
     */
    private static int getNum(String tips) {
        Scanner scanner = new Scanner(System.in);
        System.out.println(tips);
        int num = scanner.nextInt();
        return num;
    }


    /**
     * @param start
     * @param end
     */
    private static void judge(int start, int end) {
        for (int i = start; i <= end; i++) {
            if (i % 2 == 0) {
                System.out.println(i);
            }
        }
    }
}
